package l1j.opqlo.NewSystem;

import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.serverpackets.S_SkillSound;
import l1j.server.server.utils.Random;

/** 將魔法娃娃增加至角色身上素質改寫至此 **/

public class O_MagicDoll {

	private final L1PcInstance _pc;
	/** 娃娃HPR、MPR opqlo改寫 **/
	private int _hpr, _mpr;

	/** 娃娃定時回血、魔opqlo改寫 **/
	private int _timehpr, _timempr;
	/** 娃娃定時回血、魔延遲opqlo改寫 **/
	private int _timehprsec, _timemprsec;
	/** 娃娃經驗增加倍率 opqlo改寫 **/
	private double _expRate;
	/** 娃娃重量輕減opqlo改寫 **/
	private int _weightreduction;
	/** 娃娃增加防禦率opqlo改寫 **/
	private int _ac;

	/** 娃娃增加迴避率opqlo改寫 **/
	private int _dmgEvasionBydoll;
	/** 娃娃增加減傷opqlo改寫 **/
	private int _reductionChanceByDoll, _reductionByDoll;
	/** 娃娃近距離命中opqlo改寫 **/
	private int _Hit;
	/** 娃娃增加近距離傷害opqlo改寫 **/
	private int _dmgAddByDoll, _dmgAddChanceByDoll;
	/** 娃娃遠距離命中opqlo改寫 **/
	private int _bowHit;
	/** 娃娃增加遠距離傷害opqlo改寫 **/
	private int _bowdmgAddByDoll, _bowdmgAddChanceByDoll;
	private final short[] _6Values = new short[6];
	private int _registStone = 0;// 石化耐性
	private int _registSleep = 0;// 睡眠耐性
	private int _registFreeze = 0;// 凍結耐性

	private int _registSustain = 0;// 支撐耐性
	private int _registBlind = 0;// 暗闇耐性

	public O_MagicDoll(final L1PcInstance pc) {
		this._pc = pc;
	}

	/** 1=str 2=dex 3=con 4=int 5=wis 6=cha */
	public void add6ValuesByDoll(final int i, final short value) {
		this._6Values[i - 1] += value;
	}

	public void addAcByDoll(final int i) {
		this._ac += i;
	}

	public void addBowHitByDoll(final int i) {
		this._bowHit += i;
	}

	public void addExpRateByDoll(final double d) {
		this._expRate += d;
	}

	public void addHitByDoll(final int i) {
		this._Hit += i;
	}

	public void addHprByDoll(final int i) {
		this._hpr += i;
	}

	public void addMprByDoll(final int i) {
		this._mpr += i;
	}

	public void addTimeForHprByDoll(final int i) {
		this._timehpr += i;
	}

	public void addTimeForMprByDoll(final int i) {
		this._timempr += i;
	}

	public void addWeightReductionByDoll(final int i) {
		this._weightreduction += i;
	}

	/** 1=str 2=dex 3=con 4=int 5=wis 6=cha */
	public short get6ValuesByDoll(final int type) {
		return this._6Values[type - 1];

	}

	public int getAcByDoll() {
		return this._ac;
	}

	public int getBowDamageAddByDoll() {
		if (this._bowdmgAddChanceByDoll > 0
				&& this._bowdmgAddChanceByDoll >= Random.nextInt(100) + 1) {
			this._pc.sendPacketsX8(new S_SkillSound(this._pc.getId(), 6319));
			return this._bowdmgAddByDoll;
		}
		return 0;
	}

	public int getBowDmgAddByDoll() {
		return this._bowdmgAddByDoll;
	}

	public int getBowDmgAddChanceByDoll() {
		return this._bowdmgAddChanceByDoll;
	}

	public int getBowHitByDoll() {
		return this._bowHit;
	}

	public int getDamageAddByDoll() {
		if (this._dmgAddChanceByDoll > 0
				&& this._dmgAddChanceByDoll >= Random.nextInt(100) + 1) {
			this._pc.sendPacketsX8(new S_SkillSound(this._pc.getId(), 6319));
			return this._dmgAddByDoll;
		}
		return 0;
	}

	public int getDamageReductionByDoll() {
		if (this._reductionChanceByDoll > 0
				&& this._reductionChanceByDoll >= Random.nextInt(100) + 1) {
			return this._reductionByDoll;
		}
		return 0;
	}

	public int getDmgAddByDoll() {
		return this._dmgAddByDoll;
	}

	public int getDmgAddChanceByDoll() {
		return this._dmgAddChanceByDoll;
	}

	public int getdmgEvasionBydoll() {
		return this._dmgEvasionBydoll;
	}

	public double getExpRateByDoll() {
		return this._expRate;
	}

	public int getHitByDoll() {
		return this._Hit;
	}

	public int getHprByDoll() {
		return this._hpr;
	}

	public int getMprByDoll() {
		return this._mpr;
	}

	public int getReduction() {
		return this._reductionByDoll;
	}

	public int getReductionChance() {
		return this._reductionChanceByDoll;
	}

	public int getRegistBlind() {
		return this._registBlind;
	}

	public int getRegistFreeze() {
		return this._registFreeze;
	}

	public int getRegistSleep() {
		return this._registSleep;
	}

	public int getRegistStone() {
		return this._registStone;
	}

	public int getRegistSustain() {
		return this._registSustain;
	}

	public int getTimeForHprByDoll() {
		return this._timehpr;
	}

	public int getTimeForHprSecByDoll() {
		return this._timehprsec;
	}

	public int getTimeForMprByDoll() {
		return this._timempr;
	}

	public int getTimeForMprSecByDoll() {
		return this._timemprsec;
	}

	public int getWeightReductionByDoll() {
		return this._weightreduction;
	}

	public void setBowDmgAddByDoll(final int i) {
		this._bowdmgAddByDoll = i;
	}

	public void setBowDmgAddChanceByDoll(final int i) {
		this._bowdmgAddChanceByDoll = i;
	}

	public void setDmgAddByDoll(final int i) {
		this._dmgAddByDoll = i;
	}

	public void setDmgAddChanceByDoll(final int i) {
		this._dmgAddChanceByDoll = i;
	}

	public void setdmgEvasionBydoll(final int i) {
		this._dmgEvasionBydoll = i;
	}

	public void setReduction(final int i) {
		this._reductionByDoll = i;
	}

	public void setReductionChance(final int i) {
		this._reductionChanceByDoll = i;
	}

	public void setRegistBlind(final int i) {
		this._registBlind += i;
	}

	public void setRegistFreeze(final int i) {
		this._registFreeze += i;
	}

	public void setRegistSleep(final int i) {
		this._registSleep += i;
	}

	public void setRegistStone(final int i) {
		this._registStone += i;
	}

	public void setRegistSustain(final int i) {
		this._registSustain += i;
	}

	public void setTimeForHprSecByDoll(final int i) {
		this._timehprsec = i;
	}

	public void setTimeForMprSecByDoll(final int i) {
		this._timemprsec = i;
	}

	/***/

}
